// 用户请求模块

import request from '@/utils/request'

// 短信登录
export const login = data => {
  return request({
    method: 'POST',
    url: 'contract-manage/admin/login-code',
    data
  })
}

// 账号登录
export const IdLogin = data => {
  return request({
    method: 'POST',
    url: 'contract-manage/admin/login_account_code/',
    data
  })
}

// 获取验证码的接口请求
export const sendSms = mobile => {
  return request({
    method: 'POST',
    url: `contract-manage/admin/send-user-mobile?${mobile}`
  })
}

// 用户个人信息
export const userName = () => {
  return request({
    method: 'POST',
    url: 'contract-manage/admin/login-user'
  })
}

// 实名认证校验
export const realNameAuthentication = data => {
  return request({
    method: 'POST',
    url: `contract-manage/admin/user/check-user-auth?idNumber=${data}`
  })
}

// 电子签名管理
export const eSignature = data => {
  return request({
    method: 'GET',
    url: `contract-manage/admin/seal-signature/list?idNumber=${data}`
  })
}

// 获取合同摸版
export const touchVersion = data => {
  return request({
    method: 'GET',
    url: 'contract-manage/admin/template/list',
    params: data
  })
}

// 获取业务类型
export const businessTyle = () => {
  return request({
    method: 'GET',
    url: 'contract-manage/admin/contract/businesstype/business-type'
  })
}

// 文件上传
export const fileUpload = data => {
  return request({
    method: 'POST',
    url: 'contract-manage/admin/template/upload',
    data
  })
}

// 获取模板信息
export const messageTemplate = data => {
  return request({
    method: 'GET',
    url: 'contract-manage/admin/template/get-template-all-info',
    params: data
  })
}

// 添加印章签名
export const addSealSignature = data => {
  return request({
    method: 'POST',
    url: 'contract-manage/admin/seal-signature/add-seal-sign',
    data
  })
}

// 保存草稿
export const addDraft = data => {
  return request({
    method: 'POST',
    url: 'contract-manage/admin/contract/save-draft',
    data
  })
}
